import {Vfx} from './Vfx'
import {VfxList} from '../FileList'

export default class VfxLoader {
  constructor() {
    console.log('加载音效');
    this.vfx = [];
    this.init();
  }

  init() {
    for (let file in VfxList) {
      this.vfx[file] = new Vfx(VfxList[file]);
    }
  }

  finished() {
    let all = this.vfx.length;
    let fin = 0;
    for (let file in VfxList) {
      if (this.vfx[file].finished()) fin++;
    }
    return {'all': all, 'fin': fin}
  }
}
